/*
 *  Copyright 2008 Mark Ashworth <javameme@gmail.com>.
 * 
 *  Licensed under the GNU General Public License v3 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.gnu.org/licenses/gpl-3.0.html
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package xperiment.metaphor.persistence.hibernate;

import xperiment.metaphor.model.AbstractSpringJUnit;

/**
 *
 * @author Mark Ashworth <javameme@gmail.com>
 * @version 1.0.0
 */
public class HibernateEmployeeDaoTest extends AbstractSpringJUnit {
    
    public HibernateEmployeeDaoTest(String testName) {
        super(testName);
    }            

    public void testPersist() {
        logger.info("persist");
//        
//        Department department = new Department("Development");
//        department = (Department) getDao().persist(department);
//        
//        JobDescription job = new JobDescription("Senior Developer", "Design and development of applications");
//        job = (JobDescription) getDao().persist(job);
//        
//        Position[] positions = new Position[] {
//            new Position(job, department),
//            new Position(job, department)
//        };
//        for (int i = 0; i < positions.length; i++) {
//            positions[i] = (Position) getDao().persist(positions[i]);
//        }
////
////        Gender[] genders = new Gender[] {
////            new Gender("MALE"),
////            new Gender("FEMALE")
////        };
////        for(int i = 0; i < genders.length; i++) {
////            genders[i] = (Gender) getDao().persist(genders[i]);
////        }
////        PopulationGroup populationGroup = new PopulationGroup("WHITE");
////        populationGroup = (PopulationGroup) getDao().persist(populationGroup);
//
//
//        Person person =
//                new Person()
//                .firstName("Mark")
//                .lastName("Ashworth")
//                .initials("MP")
//                .dob(1974, 5, 31)
//                .identityNo("235644")
//                .male()
//                .white()
//                .user("marka", "password")
//                .employee("A001", positions[0])
//                ;
//
//        person.attach(getApplicationContext());
//        person.save();
//
//        logger.info("Person id {}", person.getId());
//        logger.info("Person {}", person.toXML());
//
//        //person = (Person) getDao().persist(person);
//        
////        Employee another = new Employee("Crystal", "Ashworth", "CA", "47625AP");
////        another.setEmployeeNo("83734636");
////        another.dateOfBirth(2001, 5, 28);
////        another.setPosition(positions[1]);
////        another.setGender(genders[1]);
////        another.setPopulationGroup(populationGroup);
////        another.setReportsTo(employee);
////
////        another = (Employee) getDao().persist(another);
    }
}
